#define CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<assert.h>
void* my_memorymove(void* dest, const void* src,size_t num)
{
	void* ret = dest;
	assert(dest && src);
	if (dest < src)
	{
		while (num--)
		{
			(*((char*)dest)++ = *((char*)src)++);
		}
	}
	else
	{
		while (num--)
		{
			*((char*)dest+num) = *((char*)src+num);
		}
	}
	return ret;
}


int main()
{
	char arr1[10] = "123456";
	printf("%s\n", arr1);
	my_memorymove(arr1+3, arr1,6);
	printf("%s\n", arr1);
	my_memorymove(arr1, arr1+3, 6);
	printf("%s\n", arr1);

	return 0;
}